package com.lin.project.hackathon.common;

import lombok.Data;

import java.io.Serializable;

/**
 * @description: 通用返回类
 * @author: linhuaixu
 * @time: 2023/5/15 10:57
 */
@Data
public class BaseResponse<T> implements Serializable {
    private int code;

    private T data;

    private String message;

    public BaseResponse(int code,T data,String message){
        this.code=code;
        this.data=data;
        this.message=message;
    }
    public BaseResponse(int code,T data){
        this(code,data,"");
    }
    public BaseResponse(ErrorCode errorCode){
        this(errorCode.getCode(),null,errorCode.getMessage());
    }
}
